<?php echo $header; ?>
<?php if ($error_warning) { ?>
<div class="warning"><?php echo $error_warning; ?></div>
<?php } ?>
<?php echo $column_left; ?><?php echo $column_right; ?>
<div id="content"><?php echo $content_top; ?>
  <div class="my-breadcrumb">
    <?php foreach ($breadcrumbs as $breadcrumb) { ?>
        <div class="breadcrumb-box">
            <a href="<?php echo $breadcrumb['href']; ?>"><?php echo $breadcrumb['text']; ?></a>
        </div>
        <div class="breadcrumb-arrow"></div>
    <?php } ?>
  </div>
  <h1><?php echo $heading_title; ?></h1>
  <form action="<?php echo $action; ?>" method="post" enctype="multipart/form-data">
    <h2><?php echo $text_your_details; ?></h2>
    <div class="content">
      <div class="row-fluid">
        <div class="span3">
          <div id="checkimage" style="position: relative; margin-bottom: 20px;">
          <div style="width: 210px; height: 210px; overflow: hidden; opacity: 0; position: absolute; z-index: 100;">
          <input name="user_thumb" type="file" style="font-size: 480px; z-index: 100; width: 210px; height: 210px;" />
          </div>
          <div class="user_avatar">
          	<img id="user_thumb" src="<?php echo $thumb_url; ?>" class="img-polaroid" style="width: 200px; height: 200px;">
          </div>
          </div>
          <div id="upload_message">*Click vào ảnh để thay đổi</div>
        </div>
        <script type="text/javascript" src="catalog/view/javascript/jquery/jquery.form.js"></script>
        <script type="text/javascript">
          $(function () {
            $("input[name=\'user_thumb\']").live('change', function () {
              $('form').ajaxForm({
                url: '<?php echo $check_image; ?>',
                dataType: 'json',
                success: function (json) {
                  if (json.status) {
                    $('#upload_message').html(json.message);
                    if (json.status == 'failed') {
                      $('#upload_message').attr('class', 'alert alert-error');
                    }else {
                      $('#upload_message').attr('class', 'alert alert-success');
                      $('#user_avatar').html('<img id="user_thumb" src="' + json.image + '" class="img-polaroid" style="width: 200px; height: 200px;">');
                    }
                  }
                }
              }).submit();
            });
          });
        </script>
        <div class="span9">
          <table class="form">
          <tr>
            <td><span class="required">*</span> <?php echo $entry_firstname; ?></td>
            <td><input type="text" name="firstname" value="<?php echo $firstname; ?>" />
              <?php if ($error_firstname) { ?>
              <span class="error"><?php echo $error_firstname; ?></span>
              <?php } ?></td>
          </tr>
          <tr>
            <td><span class="required">*</span> <?php echo $entry_lastname; ?></td>
            <td><input type="text" name="lastname" value="<?php echo $lastname; ?>" />
              <?php if ($error_lastname) { ?>
              <span class="error"><?php echo $error_lastname; ?></span>
              <?php } ?></td>
          </tr>
          <tr>
            <td><span class="required">*</span> <?php echo $entry_email; ?></td>
            <td><input type="text" name="email" value="<?php echo $email; ?>" />
              <?php if ($error_email) { ?>
              <span class="error"><?php echo $error_email; ?></span>
              <?php } ?></td>
          </tr>
          <tr>
            <td><?php echo $entry_telephone; ?></td>
            <td><input type="text" name="telephone" value="<?php if (isset($telephone)) echo $telephone; ?>" />
          </tr>
          </table>
        </div>  
      </div>
    </div>
    <div class="buttons">
      <div class="left"><a href="<?php echo $back; ?>" class="button"><?php echo $button_back; ?></a></div>
      <div class="right">
        <input type="submit" value="<?php echo $button_continue; ?>" class="button" />
      </div>
    </div>
  </form>
  <?php echo $content_bottom; ?></div>
<?php echo $footer; ?>